package parser;
import antlr.RecognitionException;
import antlr.Token;
class AugAsgnStmt extends Stmt {
    
    Expr left;
    int opID;
    Expr right;
    
    AugAsgnStmt(Expr left, String op, Expr right) throws RecognitionException {
        this.left = left;
        this.opID = NameTable.getOperatorIndex(op);
        this.right = right;
        if (left instanceof Tuple) {
            throw new RecognitionException("May not use augmented assignment on tuples");
        }
    }
     
    void write(ByteStream out) throws RecognitionException {
        out.line(line);
        left.writeAugAsgn(opID, right, out);
    }
    
}
